public class TestCircle {
    public static void main(String[] args) {
        Circle c = new Circle();
        c.r = 12.3;
        System.out.println(c.calArea());
        System.out.println(c.calPerimeter());
    }
}

class Circle {
    double r;
    //定义了一个常量
    public static final double PI = 3.14;

    public double calArea() {
        return PI*r*r;
    }

    public double calPerimeter() {
        return 2*PI*r;
    }

}
